<script>
import ErrorImage from '@/components/Error-Image'
export default {
	name: 'expert-card',
	functional: true,
	components: {
		ErrorImage,
	},
	render(h, { props: { bgc, company, createTime, expertAvatar, level, expertName, avaSkillStar } }) {
		return (<div class="pad flexsb1" style={{ 'background-color': bgc }}>
			<div class="wh40 br50 bgcommon"><ErrorImage src={expertAvatar} /></div>
			<div class="card-center pl12">
				<div class="flexsb1">{expertName}<span>{Array.from({ length: avaSkillStar }).map(() => <img src={require('@/assets/icon/wjx-active.png')} />)}{
					Array.from({ length: 5 - avaSkillStar }).map(() => <img src={require('@/assets/icon/wjx.png')} />)
				}</span><span class="time">{createTime}</span></div>
				<div class="fz12"><div class="textOver">{company}</div><span class="split-line"></span><div class="textOver">{level}</div></div>
			</div>
		</div>)
	},
}
</script>
<style lang="scss" scoped>
.flexsb1{
  display: flex;
	align-items: center;
  justify-content: space-between;
	line-height: 16px;
	overflow-x: hidden;
}
.bgcommon {
	flex: 0 0 auto;
}
.card-center{
	flex: 1 0 auto;
	height: 100%;
  width: 90%;
	img{
		width: 15px;
		height: 15px;
	}
}
.time{
  font-size: 12px;
  color: #cccccc;
}
.fz12{
  display: flex;
	margin-top: 2px;
	display: flex;
	.company {
		//flex: 1 0 auto;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}
	.level {
		flex: 0 0 auto;
	}
}
.split-line{
	display: inline-block;
	width: 1px;
	height: 12px;
	margin: 0 12px;
	background: #DDDDDD;
	vertical-align: middle;
}
.width{
  display: inline-block;
  width: 50px;
}
.textOver{
  max-width: 50%;
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}
.pad{
	padding: 12px 0;
}
</style>
